﻿@model PagedList.IPagedList<Ajax_Learning.Models.Restaurent>
@using PagedList.Mvc;
<link href="~/Content/PagedList.css" type="text/css" rel="stylesheet" />

@{
    ViewBag.Title = "Search Demo with ajax";
}

<h2>Search Demo with ajax</h2>
@*@using (Html.BeginForm("Index", "Restaurent", FormMethod.Get))
    {
        @Html.TextBox("s", ViewBag.CurrentFilter as string, new { placeholder = "Search..." })
        <input type="submit" value="Search" />
    }*@

@using (Ajax.BeginForm(new AjaxOptions
{
    HttpMethod = "get",
    InsertionMode = InsertionMode.Replace,
    UpdateTargetId = "restaurentList"
}))
{
    @Html.TextBox("s", ViewBag.CurrentFilter as string, new { placeholder = "Search..." })
    <input type="submit" value="Search" />
}
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<div id="restaurentList">
    @Html.Partial("_Restaurents", Model)
</div>
